package ch.cryptobox.serivces;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;

import org.acplt.oncrpc.OncRpcException;

import ch.cryptobox.filehandles.FileHandleI;
import ch.cryptobox.nfsError.CreateFileException;
import ch.cryptobox.nfsError.FileNotFoundException;
import ch.cryptobox.nfsError.LookupException;
import ch.cryptobox.nfsError.ReadWriteException;
import ch.cryptobox.nfsclient.diropres;
import ch.cryptobox.nfsclient.fhandle;

public interface SynchronizationService extends RemoteFileService {
	public void addFile(final File file, final byte[] data) throws OncRpcException, IOException, CreateFileException, ReadWriteException,FileNotFoundException;
	//public byte[] readFile(final File file) throws OncRpcException, IOException, CreateFileException, ReadWriteException, FileNotFoundException;
	public void addDirectory(final File file) throws OncRpcException, IOException, CreateFileException, ReadWriteException, FileNotFoundException;
	public fhandle getRootDir();
	//public FileHandleI getRootHandle();
	
	public byte[] readFile(final FileHandleI fileHandle) throws OncRpcException, IOException, ReadWriteException;
	public diropres lookup(final fhandle parent,final String name) throws OncRpcException, IOException;
	public diropres changeDir(final fhandle from, final String path) throws OncRpcException, IOException, CreateFileException, FileNotFoundException;
	public ArrayList<String> readDir(final fhandle dir) throws LookupException, OncRpcException, IOException;
	

	public int getId();
}
